package com.tiancheng.onecode.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;
import java.util.Optional;

/**
 * 进件明细状态状态
 */
@Getter
@AllArgsConstructor
public enum MerchantApplySubStatusEnums {

    ing("0", "申请中"),
    success("1", "成功"),
    final_error("2", "最终失败"),
    dgzh_yc("3", "对公账户待验证或异常（对公账户状态）"),
    zlyz_yc("4", "资料验证异常"),
    dbczl_yc("5", "待客户经理补充材料（等待客户经理处理工单）"),
    other("99", "其他异常"),
    ;


    private final String code;
    private final String msg;

    public static Optional<MerchantApplySubStatusEnums> getByCode(String code) {
        return Arrays.stream(MerchantApplySubStatusEnums.values()).filter(m -> m.getCode().equals(code)).findFirst();
    }

    ;
}
